// Copyright (c) 2024, lanlian and contributors
// For license information, please see license.txt

frappe.ui.form.on("EMS Fault Report", {
	refresh(frm) {
        // 下推生成维修派工单
        frm.add_custom_button(__('Make EMS Fault Repair Task'), () => {
            frappe.model.open_mapped_doc({
                method: "ems.equipment_managerment_system.doctype.ems_fault_report.ems_fault_report.make_fault_report_task",
                frm: cur_frm,
                freeze_message: __("Creating Task ...")
            });
        });
        // 下推外部维修单
        frm.add_custom_button(__('Make EMS External Maintenanc'), () => {
            frappe.model.open_mapped_doc({
                method: "ems.equipment_managerment_system.doctype.ems_fault_report.ems_fault_report.make_external_maintenance",
                frm: cur_frm,
                freeze_message: __("Creating Task ...")
            });
        });
	},
   
});
